package vn.pyco.prez.tapestry.services;

import vn.pyco.prez.tapestry.exception.TaskExceptionHandler;

public interface ThreadSource {

    /** 
     * runs the task using default exception handler, which writes exception to the log
     */
    public abstract void runInThread(Runnable task);

    /** 
     * runs a task in a separate thread and makes sure that tapestry ioc 
     * resources are freed after thread finishes.
     */ 
    public abstract void runInThread(final Runnable task, final TaskExceptionHandler taskExceptionHandler);

}